1ee45c430f10917c75d932217adf446d1bcb612c,Alkitab/src/main/java/yuku/alkitab/base/dialog/TypeHighlightDialog.java,TypeHighlightDialog,TypeHighlightDialog,#Context#number#IntArrayList#Listener#number#Highlights.Info#CharSequence#CharSequence#,72
Before Change
.customView(R.layout.dialog_edit_highlight, false)
.iconRes(R.drawable.ic_attr_highlight)
.positiveText(R.string.ok) // this does not actually do anything except closing the dialog.
.neutralText(R.string.delete)
.callback(new MaterialDialog.ButtonCallback() {
@Override
public void onPositive(final MaterialDialog dialog) {
// only relevant when we edit partial highlight
After Change
.customView(R.layout.dialog_edit_highlight, false)
.iconRes(R.drawable.ic_attr_highlight)
.positiveText(R.string.ok) // this does not actually do anything except closing the dialog.
.neutralText(R.string.delete)
.onPositive((dialog1, which) -> {
// only relevant when we edit partial highlight
if (verseText == null || info == null) {
return;
}
final int[] offsets = getSelectionOffsets();
assert offsets != null;
// check for changes
if ((info.partial == null && (offsets[0] != 0 || offsets[1] != verseText.length()))
||
(info.partial != null && (info.partial.startOffset != offsets[0] || info.partial.endOffset != offsets[1]))) {
select(defaultColorRgb, offsets);
}
})
.onNeutral((dialog1, which) -> select(-1, null));
if (title != null) {
builder.title(title);